<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>报账统计</title>
    <link href="../../layui/css/layui.css" rel="stylesheet" type="text/css">
    <script src="../../layui/layui.js"></script>
    <script src="../../layui/layui-xtree.js"></script>
    <link href="../../css/style.css" rel="stylesheet" type="text/css">
    <script src="../../js/jquery-1.8.3.js"></script>
    <script src="../../js/util.js"></script>
    <script>
        function getdate() {
            var myDate = new Date();
            //当前年份
            var year = myDate.getFullYear() - 1;
            return year;
        }

        layui.use(['layer', 'table', 'jquery', 'element', 'laydate'], function () {
            var table = layui.table;
            var layer = layui.layer;
            var $ = layui.$;
            var laydate = layui.laydate;

            $("#download").on('click', function () {
                location.href = '/smsCountMonth/exportYear?year=' + $("#year").val();
            });

            laydate.render({
                elem: '#year'
                , type: 'year'
                , value: getdate()
                , btns: ['confirm']
            });
            var tabledata = {
                elem: "#table",//表格id
                id: "modelReload", //id
                url: '/smsCountMonth/find',
                method: 'post',
                cellMinWidth: 100,
                request: {
                    pageName: 'page',
                    limitName: 'limit'
                },
                response: {
                    statusName: 'code',
                    statusCode: 0,
                    msgName: 'msg',
                    countName: 'count',
                    dataName: 'data'
                },
                page: true,
                count: "count",
                limit: 10,
                limits: [10, 20, 30, 40, 50],
                layout: ['prev', 'page', 'next'],
                prev: "上一页",
                next: "下一页",
                where: {year: getdate()},
                cols: [[
                    {field: 'cityName', title: '地市', rowspan: 2, fixed: 'left'}
                    , {field: 'mgrName', title: '项目名称', rowspan: 2, fixed: 'left'}
                    , {title: '1月', colspan: 5,align:'center'}
                    , {title: '2月', colspan: 5,align:'center'}
                    , {title: '3月', colspan: 5,align:'center'}
                    , {title: '4月', colspan: 5,align:'center'}
                    , {title: '5月', colspan: 5,align:'center'}
                    , {title: '6月', colspan: 5,align:'center'}
                    , {title: '7月', colspan: 5,align:'center'}
                    , {title: '8月', colspan: 5,align:'center'}
                    , {title: '9月', colspan: 5,align:'center'}
                    , {title: '10月', colspan: 5,align:'center'}
                    , {title: '11月', colspan: 5,align:'center'}
                    , {title: '12月', colspan: 5,align:'center'}], [
                    {field: 'long1', title: '长短信'}
                    , {field: 'normal1', title: '正常短信'}
                    ,{field:'longSplit1',title:'长短信拆分'}
                    ,{field:'longCount1',title:'长短信汇总'}
                    ,{field:'normalCount1',title:'正常信汇总'}
                    , {field: 'long2', title: '长短信'}
                    , {field: 'normal2', title: '正常短信'}
                    ,{field:'longSplit2',title:'长短信拆分'}
                    ,{field:'longCount2',title:'长短信汇总'}
                    ,{field:'normalCount2',title:'正常信汇总'}
                    , {field: 'long3', title: '长短信'}
                    , {field: 'normal3', title: '正常短信'}
                    ,{field:'longSplit3',title:'长短信拆分'}
                    ,{field:'longCount3',title:'长短信汇总'}
                    ,{field:'normalCount3',title:'正常信汇总'}
                    , {field: 'long4', title: '长短信'}
                    , {field: 'normal4', title: '正常短信'}
                    ,{field:'longSplit4',title:'长短信拆分'}
                    ,{field:'longCount4',title:'长短信汇总'}
                    ,{field:'normalCount4',title:'正常信汇总'}
                    , {field: 'long5', title: '长短信'}
                    , {field: 'normal5', title: '正常短信'}
                    ,{field:'longSplit5',title:'长短信拆分'}
                    ,{field:'longCount5',title:'长短信汇总'}
                    ,{field:'normalCount5',title:'正常信汇总'}
                    , {field: 'long6', title: '长短信'}
                    , {field: 'normal6', title: '正常短信'}
                    ,{field:'longSplit6',title:'长短信拆分'}
                    ,{field:'longCount6',title:'长短信汇总'}
                    ,{field:'normalCount6',title:'正常信汇总'}
                    , {field: 'long7', title: '长短信'}
                    , {field: 'normal7', title: '正常短信'}
                    ,{field:'longSplit7',title:'长短信拆分'}
                    ,{field:'longCount7',title:'长短信汇总'}
                    ,{field:'normalCount7',title:'正常信汇总'}
                    , {field: 'long8', title: '长短信'}
                    , {field: 'normal8', title: '正常短信'}
                    ,{field:'longSplit8',title:'长短信拆分'}
                    ,{field:'longCount8',title:'长短信汇总'}
                    ,{field:'normalCount8',title:'正常信汇总'}
                    , {field: 'long9', title: '长短信'}
                    , {field: 'normal9', title: '正常短信'}
                    ,{field:'longSplit9',title:'长短信拆分'}
                    ,{field:'longCount9',title:'长短信汇总'}
                    ,{field:'normalCount9',title:'正常信汇总'}
                    , {field: 'long10', title: '长短信'}
                    , {field: 'normal10', title: '正常短信'}
                    ,{field:'longSplit10',title:'长短信拆分'}
                    ,{field:'longCount10',title:'长短信汇总'}
                    ,{field:'normalCount10',title:'正常信汇总'}
                    , {field: 'long11', title: '长短信'}
                    , {field: 'normal11', title: '正常短信'}
                    ,{field:'longSplit11',title:'长短信拆分'}
                    ,{field:'longCount11',title:'长短信汇总'}
                    ,{field:'normalCount11',title:'正常信汇总'}
                    , {field: 'long12', title: '长短信'}
                    , {field: 'normal12', title: '正常短信'}
                    ,{field:'longSplit12',title:'长短信拆分'}
                    ,{field:'longCount12',title:'长短信汇总'}
                    ,{field:'normalCount12',title:'正常信汇总'}
                ]], done: function (res) {
                    layer.close(index);
                }
            };
            var index = layer.load(1, {
                shade: [0.1,'#fff'] //0.1透明度的白色背景
            });
            table.render(tabledata);
            $('#query').on('click', function () {
                var index = layer.load(1, {
                    shade: [0.1,'#fff'] //0.1透明度的白色背景
                });
                table.reload('modelReload', {
                    method: 'post',
                    page: {
                        curr: 1
                    },
                    where: {
                        year: $('#year').val()
                    }
                });
                layer.close(index);
            });
        });

    </script>
</head>
<body>
<div class="layui-content-body">
    <div class="scroll-box">
        <div class="breadcrumb-box">
              <span class="layui-breadcrumb" lay-separator="|">
   <a href="javascript:returnIndex2()">首页&nbsp;</a>
  <a href="">&nbsp;报表管理&nbsp;</a>
  <a href="">&nbsp;年度统计&nbsp;</a>
</span>
        </div>
        <div class="content-box ">
            <div class="form-select-box">
                <div class="layui-form layui-form-pane">
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label">查询年份</label>
                            <div class="layui-inline">
                                <div class="layui-input-inline" style="width:auto">
                                    <input type="text" class="layui-input" id="year" placeholder="请选择">
                                </div>
                            </div>
                        </div>
                        <div class="layui-inline">
                            <button class="layui-btn layui-btn-normal" id="query">查询</button>
                        </div>
                        <div class="layui-inline">
                            <button class="layui-btn layui-btn-normal" type="button" id="download">
                                导出
                            </button>
                        </div>
                    </div>
                </div>
            </div>
            <div class="table-box">
                <table class="layui-table" id="table">
                </table>
            </div>
        </div>
    </div>
</div>
</div>
</body>
</html>